package com.yan.demo.demo7;

import java.util.ArrayList;

public class Demo7 {
    public static void main(String[] args) {
        ArrayList<Student>list = new ArrayList<>();
        list.add(new Student("张三" , 20 , 60));
        list.add(new Student("张四" , 21 , 61));
        list.add(new Student("张五" , 22 , 62));
        list.add(new Student("张六" , 23 , 63));
        list.add(new Student("张七" , 24 , 64));
        list.add(new Student("张八" , 25 , 65));
        list.add(new Student("张九" , 26 , 66));
        list.add(new Student("张十" , 27 , 67));
        list.add(new Student("张十一" , 28 , 50));
        list.add(new Student("张十二" , 29 , 40));
        Tool tool = new Tool();
        Student maxStudent1 = tool.getMaxStudent1(list);
        System.out.println(maxStudent1);
        int avg = tool.getAvg(list, tool.getSum(list));
        System.out.println("avg = " + avg);
        tool.printFlunk(list);
    }
}
